<?php
namespace haibao\app\business;

use haibao\app\data\RequestHistory as RequestHistoryData;
use haibao\app\business\BusinessException;

class RequestHistory extends \haibao\app\business\Base {
	
	
	/**
	 * 添加访问记录
	 * @param \haibao\app\model\data\RequestHistory $requestHistoryModel
	 */
	public static function addRequestHistory($requestHistoryModel){
		$data = new RequestHistoryData ();
		$data->addRequestHistory($requestHistoryModel);
	}
	
	public static function getHistoryById($id) {
		if (! $id) {
			throw new BusinessException('id不能为空',Base::DATA_EMPTY_ID);
		}
		$requesthistoryData = new RequestHistoryData ();
		return $requesthistoryData->getOneById ( $id );
	}
	
	public static function getHistoryList($HistoryFilter) {
		$requesthistoryData = new RequestHistoryData ();
		return $requesthistoryData->getAll ( $HistoryFilter );
	}
	
	public static function addErrorMsg($userId,$systemType,$model,$content){
		$requesthistoryData = new RequestHistoryData ();
		$requesthistoryData->addErrorMsg($userId,$systemType,$model,$content);
	}
}
